<template>
  <div class="shareItem">
    <h3 v-html="info.title" @click="gotinfo"></h3>
    <div class="title van-multi-ellipsis--l2" @click="gotinfo">
      {{ info.content }}
    </div>
    <div class="other">
      <img
        class="o1"
        v-if="info.author.avatar"
        :src="$baseUrl + info.author.avatar"
        alt=""
      />
      <img class="o1" v-else src="@/assets/曾小贤.jpg" alt="" />
      <div class="o2">{{ info.author.nickname }}</div>
      <div class="o3">{{ info.created_at | formatTime }}</div>
      <i class="iconfont">&#xe65b;</i>
      <div class="o4">{{ info.read }}</div>
      <i class="iconfont">&#xe639;</i>
      <div class="o5">{{ info.star }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'shareItem',
  props: ['info'],
  data () {
    return {}
  },
  activated () {
    window.scrollTo(0, this.$route.meta.scrollTop)
  },
  methods: {
    gotinfo () {
      this.$router.push(
        '/home/shareinfo/' + this.info.id + '?path=' + this.$route.fullPath
      )
    }
  }
}
</script>

<style lang="less" scoped>
.shareItem {
  padding: 15px @p15;
  h3 {
    font-size: 16px;
    font-family: PingFangSC, PingFangSC-Medium;
    font-weight: 500;
    text-align: left;
    color: #181a39;
    line-height: 23px;
    letter-spacing: 0px;
  }
  .title {
    margin: 12px 0;
    font-size: 12px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: left;
    color: #545671;
    line-height: 18px;
    letter-spacing: 0px;
  }
  .other {
    display: flex;
    font-size: 12px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: left;
    color: #b4b4bd;
    line-height: 16px;
    letter-spacing: 0px;
    .o1 {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      margin-right: 10px;
    }
    .o3 {
      padding-left: 10px;
    }
    .iconfont {
      padding: 0 5px;
    }
  }
}
</style>
